import { http } from '@/utils/http'
import type { FullForm, InfoCartParams, updateInfoCardParams } from '@/types/member'

export const createInfoCard = (data: InfoCartParams) => {
  return http<FullForm>({
    method: 'POST',
    url: '/userInfoCard/insert',
    data,
  })
}

export const updateInfoCard = (data: updateInfoCardParams) => {
  return http<FullForm>({
    method: 'PUT',
    url: '/userInfoCard/update',
    data,
  })
}

export const getUserCard = () => {
  return http<FullForm>({
    method: 'GET',
    url: '/userInfoCard/getByUserCard',
  })
}

export const hasUserInfoCard = () => {
  return http<Boolean>({
    method: 'GET',
    url: '/userInfoCard/hasUserInfoCard',
  })
}
